#!/usr/bin/python
# -*- coding: utf-8 -*-
#Under the terms of the General Public License v.3
#For more information see LICENSE.txt

from Player import *
class Robot(Player):
	"""
	:version:
	:author:
	"""
	def __init__(self):
		Player.__init__(self, "Robot", 0, 0)
		self.movement = 5
		self.move_sound = pygame.mixer.Sound("data/sfx/robot_move.wav")
		self.move_sound.set_volume(0.75)
		
	def playMoveSound(self):
		self.move_sound.play()
		
	def stopMoveSound(self):
		self.move_sound.stop()
		
	def update(self):
		teclas = pygame.key.get_pressed()
		if teclas[K_LEFT]:
			self.playMoveSound()
			if self.rect.x > 0:
				self.rect.x -= self.movement
		if teclas[K_RIGHT]:
			self.playMoveSound()
			if self.rect.x < 593:
				self.rect.x += self.movement
		if teclas[K_UP]:
			self.playMoveSound()
			if self.rect.y > 0:
				self.rect.y -= self.movement
		if teclas[K_DOWN]:
			self.playMoveSound()
			if self.rect.y < 433:
				self.rect.y += self.movement
				
	def slowDown(self, slowPower):
		self.movement -= slowPower
		
	def powerOff(self):
		self.movement = 0
		
	def goFaster(self, fastPower):
		self.movement += fastPower
